package com.rs.dao;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.rs.model.User;
import com.rs.model.Attendance;
import com.rs.model.ReissueCard;

@Mapper
public interface ReissueCardMapper {
	int deleteByPrimaryKey(Integer res_id);

	int insert(ReissueCard record);

	ReissueCard selectByPrimaryKey(Integer res_id);

	List<ReissueCard> selectAll();

	int updateByPrimaryKey(ReissueCard record);

	/***************APP****************************/
	//添加补卡记录
	int reissueCardAddApp(ReissueCard reissueCard);

	//查看用户的所有补卡申请记录
	List<ReissueCard> reissueCardUserLookApp(ReissueCard reissueCard);

	//查询所有的待审核的补卡记录
	List<ReissueCard> reissueCardLookAllToAuditApp();

	//审核补卡记录
	int reissueCardAuditApp(ReissueCard reissueCard);

	//审核通过时,获取此条补卡记录的信息
	ReissueCard getAuditReissueCard(Integer res_id);

	//查询补卡申请的详情
	ReissueCard reissueCardLookOneApp(Integer res_id);

	//审核通过时修改考勤记录表
	int rCardAuditUpdateAttendance(Attendance attendance);

	//删除补卡记录
	int reissueCardDeleteApp(Integer res_id);

	/********PC*************/
	//pc端的条件查询
	List<ReissueCard> reissueCardConditionsQueryPc(ReissueCard reissueCard);

	//PC端的补卡时间查询
	List<User> userEntryTimeQueryPc(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

}